package dongshi.daddy.simplefactory.uml;

public class SimpleFactory {
    static final int PRODUCT_A = 1;
    static final int PRODUCT_B = 2;
    static final int PRODUCT_C = 3;
    static final int PRODUCT_D = 4;

    public static Product makeProduct(int kind) {
        if (kind == PRODUCT_A) return new ConcreteProduct1();
        if (kind == PRODUCT_B) return new ConcreteProduct2();
        if (kind == PRODUCT_C) return new ConcreteProduct3();
        if (kind == PRODUCT_D) return new ConcreteProduct4();
        return null;
    }
}
